<%--
  Created by IntelliJ IDEA.
  User: WCX
  Date: 2024/11/22
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<form action="${pageContext.request.contextPath}/welcome.jsp" method="post">
    <!-- 检查num1是否为空，如果不为空则不显示输入框和按钮 -->
    <c:if test="${empty param.num1}">
        name：<input type="text" name="num1">
        <input type="submit" value="submit" /><br />
    </c:if>
    <!-- 检查num1是否不为空，如果不为空则显示用户输入的内容 -->
    <c:if test="${not empty param.num1}">
        ${param.num1}<br />
    </c:if>
</form>
</body>
</html>